package name.sakanacatcher.repository;

import name.sakanacatcher.entity.UnRead;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UnReadRepository extends JpaRepository<UnRead,Integer> {
    List<UnRead> getAllByUserId(int id);
    UnRead getUnReadByUserIdAndMessageId(int uid,int mid);
    UnRead getUnReadByUserIdAndMessageGroupId(int uid,int gid);
    boolean existsUnReadByUserIdAndMessageId(int uid,int mid);
    boolean existsUnReadByUserIdAndMessageGroupId(int uid,int gid);
}
